var path = require('path');
var rootPath = path.normalize(__dirname + '/..');

module.exports = {
    db: {
        url : 'mongodb://localhost/schedule',
        options : {}
    },
	root: rootPath,
	logPath	   : path.join(rootPath, 'logs'),
	httpPort: 8000,
	httpsPort : 8543,
	app: { name: 'schedule'},
	currEvn : 'test',
    appkey: 'app378',
	remote : {
		test: {
            url : 'https://atwork.foreveross.com/tta',
            msgImgUrl : 'http://112.124.102.52:8000/img/push-title-img.jpg',
            msgDetailUrl: '/schedule/schedule_detail/index.html?scheduleID='
		},
		production : {
			url :   'https://atwork.foreveross.com',
			msgImgUrl : 'http://112.124.102.52:8000/img/push-title-img.jpg',
			msgDetailUrl: '/schedule/schedule_detail/index.html?scheduleID='
		}
	},
	
    constant:	{
		SUCCESS:	"success",		//后台运行成功时返回内容
		scheduleType:	{			//日程类型，任务或者会议
			TASK	:	"TASK",
			MEETING	:	"MEETING"
		},
		period:	{			//重复周期
			NONE : "NONE",	//无
			DAY  : "DAY",	//日
			WEEK  : "WEEK",	//周
			MONTH: "MONTH", //月
			YEAR : "YEAR"	//年
		},
		attitude:	{				//日程成员态度
			NEUTRAL: "NEUTRAL",		//中立，不表态
			ACCEPT : "ACCEPT",		//接受
			REFUSE : "REFUSE"		//拒绝
		},
		CommentOrLog:	{
			COMMENT :	"COMMENT",	//评论
			LOG		:	"LOG"		//日志
		},
        queryType : {
            BACK : "BACK",      //向前查询
            NEXT : "NEXT"       //向后查询
        },
		actionType:		{
			ACCEPT 	: "ACCEPT",		//接受
			REFUSE	: "REFUSE",		//拒绝
			RESTART	: "RESTART",	//重启任务
			COMPLETE: "COMPLETE"	//完成
		}
    },

	//错误码定义
	errorCode : {
		server404  : 'err404',
		server500  : 'err500',
	
		//通用错误码及提示语，以err001开头
		returnError : "err00101",					//后台出错，返回错误,
		noLogin : "err00104",						//未登录错误
		tokenAuthError : "err00105",				//鉴权失败
		serverError : "err00107",					//服务器异常
        databaseError : "err00108",					//数据库异常
        remoteGetUserError : 'err00109',            //远程获取用户信息出错
        dataVersionError    : 'err00110',            //数据版本异常修改的数据不是最新,数据乐观锁
		scheduleIsNotExist : 'err00111',				//日程不存在
		commentIsNotExist : 'err00112'				//日程不存在
	}

};